﻿using System;

namespace codeparser.net.v2.Lexer
{
    /// <summary>
    /// Represents the state changed event args.
    /// </summary>
    internal class StateChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets or sets the old state.
        /// </summary>
        /// <value>The old state.</value>
        internal StateBase OldState
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the new state.
        /// </summary>
        /// <value>The new state.</value>
        internal StateBase NewState
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        /// <value>The text.</value>
        internal string Text
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the position.
        /// </summary>
        /// <value>The position.</value>
        internal int Position
        {
            get;
            set;
        }

        /// <summary>
        /// Initializes a new instance of the StateChangedEventArgs type.
        /// </summary>
        /// <param name="oldState">The old state.</param>
        /// <param name="newState">The new state.</param>
        /// <param name="text">The text.</param>
        /// <param name="position">The position.</param>
        internal StateChangedEventArgs(StateBase oldState, StateBase newState, string text, int position)
        {
            // Initialize the fields.
            this.OldState = oldState;
            this.NewState = newState;
            this.Text = text;
            this.Position = position;
        }
    }
}